/**
 * @(#)XueTangHttpLog.java 2016年6月16日
 * Copyright(C) 2015 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package com.zhexinit.proxy.domain;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * HTTP代理请求中的上下文环境
 * 
 * @author <a href="mailto:zhaihuilin@zhexinit.com" >翟惠林</a>
 * @version 1.0.0
 */
public class HttpContext implements Serializable {
    /**
     * serialVersionUID TODO 请描述这个变量的含义
     */
    private static final long serialVersionUID = 385005180642258491L;
    public static final Logger LOGGER = LoggerFactory.getLogger(HttpContext.class);

    private String bizType;
    private String orderId;
    private int step;
    private String provinceId;
    private String cityId;
    private String imsi;
    private String uid;
    private String phoneNum;
    /**
     * 代理模式
     * 0、间接代理（默认）
     * 1、直接代理
     */
    private int proxyMode;
    private Map<String, String> cookies = new HashMap<String, String>();

    public String getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(String provinceId) {
        this.provinceId = provinceId;
    }

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public String getImsi() {
        return imsi;
    }

    public void setImsi(String imsi) {
        this.imsi = imsi;
    }

    public Map<String, String> getCookies() {
        return cookies;
    }

    public void setCookies(Map<String, String> cookies) {
        this.cookies = cookies;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public int getStep() {
        return step;
    }

    public void setStep(int step) {
        this.step = step;
    }

    public int getProxyMode() {
        return proxyMode;
    }

    public void setProxyMode(int proxyMode) {
        this.proxyMode = proxyMode;
    }

    public String getBizType() {
        return bizType;
    }

    public void setBizType(String bizType) {
        this.bizType = bizType;
    }

    public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}
	
	public String getPhoneNum() {
		return phoneNum;
	}

	public void setPhoneNum(String phoneNum) {
		this.phoneNum = phoneNum;
	}

	@Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    public String getCookiesStr(){
        if(this.cookies!=null){
            Gson gson=new Gson();
            return gson.toJson(cookies);
        }
        return "";
    }
    
}
